/*
 * author Vdaras
 */

#include "GlobalTimer.h"

GlobalTimer::GlobalTimer()
{
    m_lastUpdate = 0;
    m_delta = 0;
}

GlobalTimer::~GlobalTimer()
{
}

/**
 * Notifies the Global Timer that a new frame has started
 */

void GlobalTimer::MarkFrameStart()
{
    Uint32 now = SDL_GetTicks();
    m_delta = now - m_lastUpdate;
    m_lastUpdate = now;
}

/**
 * @return how much time has passed since the last frame.
 */

Uint32 GlobalTimer::GetDeltaTime()
{
    return m_delta;
}

